#ifndef REPLAYSTATE_H
#define REPLAYSTATE_H

class ReplayState;

#include "GameState.h"
#include "Ball.h"
#include "PlayState.h"
#include "ReplayController.h"
#include <stdlib.h>
#include <vector>

/*
 * class to handle specifics of watching a replay
 */
class ReplayState : public PlayState
{
public:
    ReplayState() : PlayState() {}
    virtual bool keyPressed(const OIS::KeyEvent &);
    static void addReplay(ReplayController *rc);
    static void removeAllReplays();
    
protected:
    virtual void enterExtras() {}
    virtual void initialisePlayers();
    virtual void startPlaying();
    virtual void stopPlaying();
    virtual void initialiseHUD() {}
    virtual void playerFallout();
    virtual void updateHUD(Ogre::Real timeSinceLastFrame) {}
    virtual void initialiseCountdownOverlay() {}
    virtual void updateCountdownOverlay() {}
    virtual void initialiseExtraOverlays();
    virtual void updateExtraOverlays();
    virtual bool ogreNewtNeedsUpdate();
    virtual float getOgreNewtUpdateTime();
    virtual void setStopPlaying();
    float getTimeUntilUserCanControl() { return 0.0; }
    
private:
    Ogre::Overlay *replay_overlay;
    static std::vector<ReplayController *> replay_controllers;
    unsigned int ogrenewt_controller_index;
};

#endif

